import service from '@/config/api/http'

export async function getUrl() {
    let res = await service({
        url: 'http://121.40.237.31:38000/cros-forward?url=http://60.205.204.130:8080/manage/app/getCameraPreviewURL?cameraIndexCode=c0a17c31ace6437199040256e8b973a4',
        method: 'get'
    })
    res = JSON.parse(res)
    return res.data.url
}

export function getHlsUrl(cameraIndexCode) {
    return service({
        // url: `http://localhost:33001/frame/hai-kang/get-stream-url?cameraIndexCode=${cameraIndexCode}&streamUrlProtocol=hls`,
        url: `/frame/hai-kang/get-stream-url?cameraIndexCode=${cameraIndexCode}&streamUrlProtocol=PROTOCOL_HLS&channelBusinessId=40289f5a7e3c994d017e3c998daf0000`,
        method: 'get'
    })
}